home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // $RCSfile: polyCleanup.mel $
- //
- // $Source: /vobs/aw/Maya/src/PolySlice/Commands/scripts/polyCleanup.mel $
- // $Locker: $
- //
- // $Author: mmah $
- // $Revision: /main/3 $
- // $Date: 1999/12/20 15:16:37 $
- //
- // Copyright (C) 1999 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: May 11, 1999
- // Last Updated: June 4, 1999
- // Author: Bernard Kwok
- //
- // Procedure Name:
- //
- // polyCleanup (command).
- //
- // Input Arguments:
- // 0 / 1 : Do the cleanup on all selectable meshes
- // 0 / 1 : Only select things that need to be cleaned up
- // 0 / 1 : With or without construction history
- //
- // 0 / 1 : Triangulate 4-sided faces
- // 0 / 1 : Triangulate > 4-sided faces
- // 0 / 1 : Triangulate concave faces
- // 0 / 1 : Triangulate holed faces
- // 0 / 1 : Triangulate non-planar faces
- //
- // 0 / 1 : Delete zero area faces
- // <float> : Face tolerance
- // 0 / 1 : Delete zero area edges
- // <float> : Edge tolerance
- // 0 / 1 : Delete faces with zero area map (uv area)
- // <float> : Map tolerance
- // Returns:
- // string, of items affected. Empty if no items affected.
- //
- // Example:
- // // Select from all meshes, all of the criteria
- // //
- // polyCleanup 1 1 1 1 1 1 1 1 1 0.1 1 0.1 1 0.1;
- //
- // Description:
- //
- // Perform a 'cleanup' of various 'bad' polygon geometry
- // attributes. This includes:
- //
- // Deletion of:
- // - zero area face
- // - zero area edges
- // - zero area mapped faces
- //
- // Triangulization of :
- // - non-planar polygons
- // - 4 to N sided polygons
- // - concave polygons
- // - polygons with holes.
- //
- // Triangulization will occur first, before deletion.
- //
- //
- //////////////////////////////////////////////////////////////////////
-
- global proc string[]
- polyCleanup(int $allMeshes, int $selectOnly, int $historyOn,
- int $quads, int $nsided, int $concave, int $holed,
- int $nonplanar, int $zeroGeom, float $zeroGeomTol,
- int $zeroEdge, float $zeroEdgeTol, int $zeroMap,
- float $zeroMapTol)
- //
- // Description:
- // Perform a cleanup on polygonal meshes (command)
- // Arguments:
- // allMeshes : All selectable meshes
- // selectOnly : Only perform a selection
- // historyOn : keep construction history
- //
- // quads : check for quads polys
- // nsided : check for n-sided polys
- // nonplanar : check fo non-planar polys
- // holed : check for holed polys
- // concave : check for concave polys
- //
- // zeroGeom : check for 0 area faces
- // zeroGeomTol : tolerance for face areas
- // zeroEdge : check for 0 length edges
- // zeroEdgeTol : tolerance for edge length
- // zeroMap : check for 0 uv face area
- // zeroMapTol : tolerance for uv face areas
- //
- // Returns:
- // list of items cleaned up. Empty if none
- //
- {
- string $args[] = {(string)
- $allMeshes,
- $selectOnly,
- $historyOn,
- $quads,
- $nsided,
- $concave,
- $holed,
- $nonplanar,
- $zeroGeom,
- $zeroGeomTol,
- $zeroEdge,
- $zeroEdgeTol,
- $zeroMap,
- $zeroMapTol
- };
- return (polyCleanupArgList ("1", $args));
- }
-